1. Field of the Invention
The present invention relates to an apparatus for and a method of correcting data representing saturation (color saturation, chromaticness, colorfulness or chroma), an apparatus for and a method of calculating maximum saturation, and an apparatus for and a method of correcting pixel data, and a method of determining a saturation correction curve.
2. Description of the Background Art
A color image read using a color scanner or the like may, in some cases, be insufficient in (color) saturation. In such a color image, correction processing for emphasizing saturation may, in some cases, be performed. In a coordinate system (an L*a*b* coordinate system, an L*u*v* coordinate system, etc.) in a uniform perception color space (uniform perceptual space) which can be handled independently by lightness (luminance), saturation and hue, the saturation is multiplexed by a fixed coefficient (constant value), to perform correction for emphasizing the saturation.
However, saturation which can be expressed is limited. When the (color) saturation (colorfulness) is multiplexed by a uniform fixed coefficient to perform correction for emphasizing the (color) saturation (colorfulness), therefore, data representing the (color) saturation (colorfulness) after the corrected may, in some cases, be saturated. Color compression occurs by the saturation.
An object of the present invention is to emphasize saturation without causing color compression.
Another object of the present invention is to calculate maximum saturation which can be taken by one pixel.
Still another object of the present invention is to make it possible to change maximum saturation.
A saturation correcting apparatus according to a first aspect of the present invention is characterized by comprising saturation data input means for inputting saturation data relating to an image corresponding to one frame which should be corrected; and correction means for performing, with respect to the saturation data relating to the image corresponding to one frame which has been inputted from the saturation data input means, saturation correction processing based on a correction curve for emphasizing and outputting, when the saturation data relating to one of pixels composing the image corresponding to one frame represents intermediate saturation between maximum saturation and minimum saturation which the saturation data relating to the one pixel can take, the saturation data, while outputting, when the saturation data represents the maximum saturation, the saturation data upon stopping the emphasis processing.
The first aspect of the present invention also provides a method suitable for the above-mentioned apparatus. That is, the method comprises the steps of inputting saturation data relating to an image corresponding to one frame which should be corrected; and performing, with respect to the inputted saturation data relating to the image corresponding to one frame, saturation correction processing based on a correction curve for emphasizing and outputting, when the saturation data relating to one of pixels composing the image corresponding to one frame represents intermediate saturation between maximum saturation and minimum saturation which the saturation data relating to the one pixel can take, the saturation data, while outputting, when the saturation data represents the maximum saturation, the saturation data upon stopping the emphasis processing.
According to the first aspect of the present invention, the saturation data relating to the image corresponding to one frame which should be corrected is inputted. Such correction that the saturation data relating to one of the pixels composing the image corresponding to one frame is emphasized and outputted when it represents the intermediate saturation between the maximum saturation and the minimum saturation which the saturation data relating to the one pixel can take, while being outputted upon stopping the emphasis processing when it represents the maximum saturation is made with respect to the saturation data relating to the image corresponding to one frame.
According to the first aspect of the present invention, when the saturation data relating to the one pixel represents the maximum saturation which the saturation data relating to the one pixel can take, no correction for emphasizing saturation is made. Accordingly, it is possible to prevent the saturation data from being saturated by correction for emphasizing saturation. Consequently, it is possible to prevent color compression from occurring by the saturation emphasis processing. When the saturation data relating to the one pixel represents the intermediate saturation, correction for emphasizing saturation is made. A sharp image is thus obtained.
When the saturation data relating to one of the pixels composing the image corresponding to one frame represents the maximum saturation or the minimum saturation, it may be outputted as it is. When the saturation data represents the maximum saturation, processing for decreasing the saturation may be performed.
The saturation correcting apparatus may further comprise a correction curve producing device for producing the correction curve. The correction curve may be produced in the form of a table and previously stored.
The correction curve may be determined such that the saturation represented by the saturation data after the saturation correction processing is less than the maximum saturation. In the intermediate saturation, it is possible to prevent the saturation data after the correction from being saturated even if the correction for emphasizing saturation is made.
The correction curve can be realized by a circular arc or a polygonal line, for example.
The correction curve can be specifically determined on the basis of the maximum saturation calculated on the basis of luminance data and hue angle data which correspond to the saturation data.
An average of the saturation data relating to the image corresponding to one frame is calculated, to determine the correction curve such that the lower the calculated average is, the higher the degree of correction is, while the higher the calculated average is, the lower the degree of correction is.
The saturation correcting apparatus may further comprise correction value calculation means for calculating a color difference correction value from the characteristics of color difference data relating to the image corresponding to one frame which should be corrected; and subtraction means for subtracting the color difference correction value from the color difference data relating to the image corresponding to one frame which should be corrected. In this case, the correction means will perform the saturation correction processing on the basis of the correction curve with respect to the saturation data corresponding to the color difference data from which the color difference correction value has been subtracted by the subtraction means.
A color based on an imaging light source at the time of imaging may, in some cases, be further overlapped with a subject image (so-called color fogging). In a case where the saturation is emphasized when the color fogging occurs, the color fogging may, in some cases, be further emphasized.
A predetermined color difference correction value is subtracted from the color difference data relating to the image corresponding to one frame which should be corrected. Accordingly, it is possible to prevent the color fogging from being emphasized even if the saturation is corrected.
The saturation correcting apparatus may further comprises range calculation means for respectively finding a first range in which the values of the three primary colors are not more than their maximum values in first luminance of less than the maximum luminance and a second range in which the values of the three primary colors are not less than their minimum values in second luminance of more than the minimum luminance; first saturation calculation means for finding first maximum saturation defined by the first range of the values of the three primary colors and in the hue of the one pixel whose maximum saturation should be found and second maximum saturation defined by the second range of the values of the three primary colors and in the hue of the one pixel whose maximum saturation should be found; second saturation calculation means for calculating saturation in the luminance of the one pixel whose maximum saturation should be found, that is, first corresponding saturation corresponding to the first maximum saturation and second corresponding saturation corresponding to the second maximum saturation; and saturation determination means for determining the saturation having the smaller value out of the first corresponding saturation and the second corresponding saturation which have been calculated by the second saturation calculation means to be the maximum saturation. Consequently, the maximum saturation can be calculated. The first luminance and the second luminance may be the same or different from each other.
The maximum saturation calculating apparatus can be also individually constructed. The present invention also provides a method of calculating maximum saturation. That is, in an apparatus for finding maximum saturation which pixel data representing each of pixels can take, the method comprises the steps of respectively finding a first range in which the values of the three primary colors are not more than their maximum values in first luminance of less than maximum luminance and a second range in which the values of the three primary colors are not less than their minimum values in second luminance of more than minimum luminance; finding first maximum saturation defined by the first range of the values of the three primary colors and in the hue of the one pixel whose maximum saturation should be found and second maximum saturation defined by the second range of the values of the three primary colors and in the hue of the one pixel whose maximum saturation should be found; calculating saturation in the luminance of the one pixel whose maximum saturation should be found, that is, first corresponding saturation corresponding to the first maximum saturation and second corresponding saturation corresponding to the second maximum saturation; and determining the saturation having the smaller value out of the found first corresponding saturation and second corresponding saturation to be the maximum saturation taken by the pixel data.
The first saturation and the second saturation may be previously stored (in storage means), to calculate the maximum saturation using the stored first saturation and second saturation.
The first luminance and the second luminance may be determined such that luminance obtained by the weighted mean of the first luminance and the second luminance is intermediate luminance between the minimum luminance and the maximum luminance. In this case, one of the first range of the values of the three primary colors and the second range of the values of the three primary colors is found on the basis of the other range.
A pixel data correcting apparatus according to a second aspect of the present invention is characterized by comprising luminance calculation means for calculating luminance in which maximum saturation is given in the hue of a pixel to be corrected whose saturation should be corrected; and luminance correction means for correcting, when there is a difference between the luminance calculated by the luminance calculation means and the luminance of the pixel to be corrected, the luminance of the pixel to be corrected such that the difference is decreased.
The second aspect of the present invention also provides a method suitable for the above-mentioned apparatus. That is, the method comprises the steps of calculating luminance in which maximum saturation is given in the hue of a pixel to be corrected whose saturation should be corrected; and correcting, when there is a difference between the calculated luminance and the luminance of the pixel to be corrected, the luminance of the pixel to be corrected such that the difference is decreased.
As described above, the maximum saturation which a certain pixel can take is limited. However, the maximum saturation which the pixel can take can be further increased by changing the luminance of the pixel.
According to the second aspect of the present invention, the luminance in which the maximum saturation is given in the hue of the pixel to be corrected is calculated. When there is a difference between the calculated luminance and the luminance of the pixel to be corrected, the maximum saturation can be further increased by changing the luminance. When there is a difference between the calculated luminance and the luminance of the pixel to be corrected, therefore, the luminance of the pixel to be corrected is corrected such that the difference is decreased. Even if the luminance is changed, the saturation can be further increased.
The saturation of the pixel to be corrected whose luminance has been corrected is thus corrected. A sharper pixel can be thus obtained.
The pixel data correcting apparatus may further comprise determination means for determining the amount of correction of the luminance by the luminance correction means on the basis of the hue, the saturation of the pixel to be corrected or the ratio of the saturation to the maximum saturation.
The correction amount of the luminance may be limited to not more than a predetermined amount. An image whose lightness hardly differs from the lightness of the image actually obtained is obtained. The correction amount of the luminance may be limited depending on the hue, the saturation, or so forth.
A pixel data correcting apparatus according to a third aspect of the present invention is characterized by comprising judgment means for judging whether or not maximum saturation in the hue of a pixel to be corrected whose saturation should be corrected can be further increased by changing the hue; and hue change means for changing the hue of the pixel to be corrected such that the maximum saturation is increased in response to the judgment by the judgment means that the maximum saturation can be further increased by changing the hue.
The third aspect of the present invention also provides a method suitable for the above-mentioned apparatus. That is, the method comprises the steps of judging whether or not maximum saturation in the hue of a pixel to be corrected whose saturation should be corrected can be further increased by changing the hue; and changing the hue of the pixel to be corrected such that the maximum saturation is increased in response to the judgment that the maximum saturation can be further increased by changing the hue.
According to the third aspect of the present invention, it is judged whether or not the maximum saturation can be further increased by changing the hue. When the maximum saturation can be further increased, the hue of the pixel to be corrected is changed to be further increased. Even if the hue is changed, the saturation can be further increased. This is suitable for a case where it is desired to emphasize sharpness rather than the hue. The saturation of the pixel to be corrected whose hue has been corrected is thus corrected. A sharper pixel can be thus obtained.
Also in this case, the hue may be changeable in a predetermined range.
A pixel data correcting apparatus according to a fourth aspect of the present invention is characterized by comprising input means for inputting data representing the hue of a pixel to be corrected whose saturation should be corrected; and hue change means for bringing the hue represented by the hue data inputted from the input means near the hue at the shorter distance from the hue of the pixel out of the hues of the primary colors with the hue of the pixel interposed therebetween.
The fourth aspect of the present invention also provides a method suitable for the above-mentioned apparatus. That is, the hue of a pixel to be corrected whose saturation should be corrected is brought near the hue at the shorter distance from the hue of the pixel out of the hues of the primary colors with the hue of the pixel interposed therebetween.
Such correction also makes it possible to obtain a sharp pixel.
A fifth aspect of the present invention is directed to a saturation correcting apparatus for correcting the saturation of each of pixels on the basis of a correction curve having correction characteristics for emphasizing and outputting inputted saturation, characterized by comprising calculation means for calculating the shortest one of the distances on a color space between the color of the pixel whose saturation should be corrected and the three primary colors; and means for determining the correction curve such that the maximum saturation which can be inputted is further emphasized and outputted, and the larger the distance calculated by the calculation means is, the higher the degree of the emphasis is, while the smaller the distance is, the lower the degree of the emphasis is.
The fifth aspect of the present invention also provides a correction curve determining method suitable for the above-mentioned apparatus. That is, in an apparatus for correcting the saturation of each of pixels on the basis of a correction curve having correction characteristics for emphasizing and outputting inputted saturation, the method comprises the steps of calculating the shortest one of the distances on a color space between the color of the pixel whose saturation should be corrected and the three primary colors; and determining the correction curve such that the maximum saturation which can be inputted is further emphasized and outputted, and the larger the calculated distance is, the higher the degree of the emphasis is, while the smaller the distance is, the lower the degree of the emphasis is.
According to the fifth aspect of the present invention, the respective distances on the color space between the color of the pixel whose saturation should be corrected and the three primary colors are calculated. The correction curve is determined such that the farther the color of the pixel whose saturation should be corrected is away from the primary colors (the larger the distance is), the lower the degree of the emphasis is, while the nearer the color of the pixel whose saturation should be corrected is to the primary colors (the larger the distance is), the higher the degree of the emphasis is. The saturation is corrected on the basis of the determined correction curve.
When the color of the pixel whose saturation should be corrected is near to the primary colors, the possibility that so-called color compression occurs is increased if the saturation is emphasized in excess of 100%. According to the fifth aspect of the present invention, when the color of the pixel whose saturation should be corrected is near to the primary colors, the degree of the emphasis is decreased, thereby reducing the possibility that color compression occurs. When the color of the pixel whose saturation should be corrected is farther away from the primary colors, the degree of the emphasis is increased to exceed 100%. Accordingly, it is possible to obtain a sharp pixel whose saturation has been further emphasized.
The foregoing and other objects, features, aspects and advantages of the present invention will become more apparent from the following detailed description of the present invention when taken in conjunction with the accompanying drawings.